package com.framework.sch.util;

import java.util.Properties;

import org.springframework.core.io.Resource;

import com.framework.bas.exception.BasException;

public class PlmSchManagerFactory {
	
	private Resource resource;
	private Properties properties;
	private static PlmSchFactory instance;

	public Resource getResource() {
		return resource;
	}

	public void setResource(Resource resource) {
		this.resource = resource;
	}
	
	public PlmSchFactory getInstance(){
		if (instance == null){
			try{
				properties = new Properties();
				properties.load(resource.getInputStream());
				instance = new PlmSchFactory(properties);
			}catch(Exception e){
				throw new BasException("", e);
			}finally{
			}
		}
		return instance;
	}

}
